package com.itheima.sort;

import java.lang.reflect.Array;
import java.util.*;

import static java.lang.reflect.Array.*;

public class Demo1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Random ran = new Random();
        int count = sc.nextInt();
        int[] a = new int[count];
        for (int i = 0; i < a.length; i++) {
            a[i] = ran.nextInt(1000);
            System.out.print(a[i] + "-");
        }
        System.out.println();
        Arrays.parallelSort(a);
        for (int i = 0; i < a.length; i++) {
            System.out.print(a[i] + "-");
        }
    }
}
